<?php
class DataFbToken{
	private $Token = array();
	private $ExprirateDate = array();
	function __construct(){
	}
	  static function swap($buf){
		$obj = new DataFbToken();
		$obj->Token = DataUtil::readSBin( $buf ) ;
		$obj->ExprirateData = DataUtil::readBBin( $buf ) ;
		return $obj;
	}
	  function getBinSize(){
		$size = 0;
		$size += 2  + count($this->Token);
		$size += 1  + count($this->ExprirateData);
		return $size;
	}
	  function setToken($token, $exprirate){
		$this->Token = unpack('C*', $token ) ;
		$this->ExprirateData = unpack('C*', $exprirate ) ;
	}
	  function getToken(){
		return implode(array_map("chr",  $this->Token )) ;
	}
	  function getExprirateDate(){
		return implode(array_map("chr",  $this->ExprirateDate )) ;
	}
	  function getBinary(){
		$buf = ByteBuffer::allocate( $this->getBinSize() ) ;
		DataUtil::writeSBin( $buf ,  $this->Token ) ;
		DataUtil::writeBBin( $buf ,  $this->ExprirateData ) ;
		return  $buf ->_array() ;
	}
}
?>